package git;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Scanner;

public class Mian2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ArrayList<String> list = new ArrayList();
        LinkedList<String> list1 = new LinkedList();
        int count=0;
        while (scanner.hasNext()){
            String str =scanner.next();
            count++;
            list.add(str);
            if(count==6)
                break;
        }

        for (String s : list) {
            StringBuilder sb = new StringBuilder();
            sb.append(s);
            sb.reverse();
            list1.add(sb.toString());
        }
        for (int i = list1.size()-1; i >=0 ; i--) {
            System.out.println(list1.get(i));
        }
    }
}
